#!/usr/bin/env python
#    dftmm_7
#    -----------
#    Molecule:         CH2O(DFT)/2 H2O(MM)
#    Wave Function:    B3LYP / STO-3G  
#    Test Purpose:     DFT/MM LR with matrix inversion and exponential damping
#                      RF calculated at the QM nuclei

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

#enedft
f.add(string = 'Final DFT energy',
      rel_tolerance = 1.0e-9)

#qm3convergence
f.add(from_string = 'QM/MM "QM3" calculation converged',
      num_lines = 6,
      rel_tolerance = 1.0e-5)

# Test of polarizability
f.add(re = '[XYZ]DIPLEN  \; [XYZ]DIPLEN',
      rel_tolerance = 1.0e-9)

test.run(['dftmm_7.dal'], ['CH2O_STO-3G_2H2O_MM.mol'], f={'out': f}, args='-put POTENTIAL.INP')

sys.exit(test.return_code)
